package erp.education.web.action.setup.school;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import erp.education.client.setup.school.StreamRequest;
import erp.education.server.beans.interfaces.setup.school.StreamServiceI;
import erp.education.web.common.BaseAction;

public class StreamAction extends BaseAction implements
		ModelDriven<StreamRequest> {
	@Autowired
	StreamRequest streamRequest;
	@Autowired
	StreamServiceI streamService;

	public String streamLoad() throws Exception {

		this.result = streamService.streamLoadService(streamRequest)
				.getResponseObject();

		getRequest().setAttribute("result", this.result.getResultList());
		return "loadStreams";
	}

	public String saveUpdateStreamDetails() throws Exception {
		this.result = streamService.saveUpdateStreamDetails(streamRequest)
				.getResponseObject();
		return "loadStreams";
	}

	@Override
	public StreamRequest getModel() {
		return this.streamRequest;
	}
}
